package com.ultrawise.bank.dao.assistTools;

public class DataConvert {
		
	/**
	 * @Segmentation string width the ":".
	 * 
	 * @param key_value The key_value is shaped like "key:value" of string.
	 * @param order The order value is serial number of key or value.
	 * 
	 * @return The result is string of key or value or null,
	 *   if order equals 0 or 1 or other.
	 *   
	 */
	public static String keyValueSeparate(String key_value, int order)
	{
		String[] str = key_value.split(":");
		if(str.length != 2)
		{
			return null;
		}
		if(order == 0)
		{		
			return str[0];
		}else if(order == 1)
		{
			return str[1];
		}else
		{
			return null;
		}	
	}

}
